/**
 * 切换tab
 * @param me
 * @param index
 */
const switchTab = function (me, index) {
  if (typeof me.getTabBar === 'function' && me.getTabBar()) {
    me.getTabBar().setData({
      active: index,
    })
  }
};

/**
 * 显示tabbar
 * @param me
 * @param success
 */
const showTab = function (me, success) {
  if (typeof me.getTabBar === 'function' && me.getTabBar()) {
    me.getTabBar().showTab(success);
  }
};

/**
 * 隐藏tabbar
 * @param me
 * @param success
 */
const hideTab = function (me, success) {
  if (typeof me.getTabBar === 'function' && me.getTabBar()) {
    me.getTabBar().hideTab(success);
  }
};

module.exports = {
  switchTab,
  showTab,
  hideTab
};